package com.woniu.gf.pawn.gateway.config;

import org.springframework.stereotype.Component;
import springfox.documentation.swagger.web.SwaggerResource;
import springfox.documentation.swagger.web.SwaggerResourcesProvider;

import java.util.Arrays;
import java.util.List;

/**
 * @BelongsProject: gf-pawn-system
 * @BelongsPackage: com.woniu.gf.pawn.gateway.config
 * @Author: wu wei
 * @CreateTime: 2020-10-17 09:19
 * @Description:
 */
@Component
public class SwaggerConfig implements SwaggerResourcesProvider {
    @Override
    public List<SwaggerResource> get() {
        return Arrays.asList(
                getSr("management-server","1.0","/management/v2/api-docs"),
                getSr("store-server","1.0","/store/v2/api-docs"),
                getSr("product-server","1.0","/product/v2/api-docs"),
                getSr("productentity-server","1.0","/product-entity/v2/api-docs"),
                getSr("shop-server","1.0","/shop/v2/api-docs")
        );
    }
    private SwaggerResource getSr(String name,String version,String url){
        SwaggerResource sr=new SwaggerResource();
        sr.setName(name);
        sr.setSwaggerVersion(version);
        sr.setUrl(url);
        return sr;

    }
}
